@model IEnumerable<University.Models.Professor>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            FirstName
        </th>
        <th>
            LastName
        </th>
        <th>
            Birthday
        </th>
        <th>
            Rang
        </th>
        <th>
            Marks
        </th>
        <th>
            ScheduleItmes
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ProfessorId }) |
            @Html.ActionLink("Details", "Details", new { id=item.ProfessorId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ProfessorId })
        </td>
        <td>
			@item.FirstName
        </td>
        <td>
			@item.LastName
        </td>
        <td>
			@String.Format("{0:g}", item.Birthday)
        </td>
        <td>
			@item.Rang
        </td>
        <td>
			@(item.Marks == null ? "None" : item.Marks.Count.ToString())
        </td>
        <td>
			@(item.ScheduleItmes == null ? "None" : item.ScheduleItmes.Count.ToString())
        </td>
    </tr>
}

</table>


